package com.elvende.web.client.view;

import com.elvende.web.client.dto.AffortableHousing;
import com.elvende.web.client.view.component.CategoryPanel;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Widget;

public class LifeView extends View implements com.elvende.web.client.presenter.LifePresenter.Display {

	private static LifeUiBinder uiBinder = GWT.create(LifeUiBinder.class);

	interface LifeUiBinder extends UiBinder<Widget, LifeView> {}

	// @UiField
	// TopPanel topPanel;	
	
	@UiField
	FlexTable table;
	
	@UiField
	CategoryPanel categoryPanel;

	
	public LifeView() {
		initWidget(uiBinder.createAndBindUi(this));
				    
		table.getColumnFormatter().setWidth(0, "128px");
		table.getColumnFormatter().setWidth(1, "192px");
		table.getColumnFormatter().setWidth(2, "256px");		
	}

	public void setAffortableHousing(AffortableHousing[] housingData) {
		int i=1;
		for (AffortableHousing house : housingData){
			table.setText(i, 0, house.getName());
			table.setText(i, 1, house.getName());
			table.setText(i, 2, house.getName());
			i++;
		}				
	}

	public HasClickHandlers getList() {
		// TODO Auto-generated method stub
		return null;
	}
}